<?php
session_start();
if (!$_SESSION["status"]) {
    header("location:../managerlogin.php");
}
include_once "../model/model.php";
include_once "../model/pile.php";

define("ERROR", "操作失败!");

if (isset($_POST["check"])) {
	$night = new NIGHT();
	if ($night->review_night($_POST["name"], $_POST["date"], $_POST["check"]) === NIGHT::ok) {
		header("location:../admin/check.php");
		/* echo "<script>window.location.assign('../admin/check.php')</script>"; */
	} else {
		/* echo "操作失败!"; */
		$status = -1;
	}
}
?>
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf8">
        <title>管理员审核表</title>

        <link rel="stylesheet" href="../public/css/bootstrap.min.css">
        <link rel="stylesheet" type="text/css" href="../css/main.css">

    </head>
    <body>
        <div id = "main">
            </br>
            </br><br><br><br><br><br>

            <p><div id = "line6"></p>

                <h1 align="center"><strong>处理结果</strong></h1>

                <h2 align="center">

                    <?php
                    /* include_once "../model/model.php"; */
                    /* include_once "../model/pile.php"; */

                    /* if (isset($_POST["check"])) { */
                    /*     $night = new NIGHT(); */
                    /*     if ($night->review_night($_POST["name"], $_POST["date"], $_POST["check"]) === NIGHT::ok) { */
                    /*         /1* header("location:../admin/check.php"); *1/ */
							/* echo "<script>window.location.assign('../admin/check.php')</script>"; */
                    /*     } else { */
                    /*         echo "操作失败!"; */
                    /*     } */
                    /* } */
					if($status === -1)
					{
						echo ERROR;
					}
                    echo "<a href = '../admin/check.php'>返回</a>";
                    ?>
                </h2>
            </div>
        </div>
    </body>
</html>
